/***************************************************
*	FileName    :	main.cpp
*	Description :	
*	Created		:	
*   Compiler	:	g++ -o eightPuzzle -g eightPuzzle.h eightPuzzle.cpp main.cpp	
*	
*	Author		:	Victor, mcvector.gu@gmail.com
*	Company		:	College of Information Technology and Science, Chengdu University Of Technology
******************************************************/
#include "eightPuzzle.h"
int main()
{
	cout<<"Please input start Statei col by col: \n";
	//initial startState by user input
	vector<int> initialTemp(3,0);
	vector< vector<int> > startState(3,initialTemp);
	PrioQueue testQueue;
	for(int i=0; i<3; i++)
	  cin>>startState.at(i).at(0)>>startState.at(i).at(1)>>startState.at(i).at(2);
	//debug begin
	//for(int i=0; i<3; i++)
	//  cout<<startState.at(i).at(0)<<startState.at(i).at(1)<<startState.at(i).at(2)<<endl;
/*	
	cout<<"debug info:\nOriginal State\n";		
	StateNode testNode(startState);		//create a testNode!
	StateNode testNode2(startState);
	testQueue.push(&testNode);			//push it into testQueue
	testQueue.push(&testNode2);
	cout<<"the top of queue:\n";		
	cout<<*(testQueue.top())<<endl;		//cout the top
	cout<<"The queue state now:"<<testQueue.isEmpty()<<endl;
	cout<<"The size now:"<<testQueue.size()<<endl;
	testQueue.pop();
	cout<<"after poop:"<<testQueue.isEmpty()<<endl;
	cout<<"The size now:"<<testQueue.size()<<endl;
*/
	

	
	StateTree puzzle1(startState);
	cout<<"The goal state you gonna reach is:\n";
	puzzle1.showGoalState();
	puzzle1.solve();
	cout<<"How to:\n";
	puzzle1.showResult();
	return 0;
}


